<?php
	get_header();
?>
<?php
    global $wpdb;
    $category = get_category( get_query_var( 'cat' ) );
    $cat_id = $category->term_taxonomy_id;
    $cat_obj = get_category($cat_id);
    $deactive_deals_ids_by_cat = cpx_get_active_deals($cat_id);
    $row_display = get_option('number_row_category');
    $display = $row_display*4;
    if($row_display == ''){
        $display = 16;
    }
?>
<div id="all-deals">
    <h1 id="inner-title"> <?php echo $cat_obj->name; ?> deals</h1>
    <hr/>
    <div class="categories-menu">
        <?php 
            $link_all_deals = site_url('/all-deals/');
        ?>
        <span class=""><a class="list-by-category" href="<?php echo $link_all_deals;?>" title="See all deals">All Deals</a></span>
        <?php
            cpx_print_categories();
        ?>
    </div>
    <hr/>
    <div class="all-deals-list row-fluid">
       <?php 
        if(count($deactive_deals_ids_by_cat) > 0)
          {
             pagination_jquery($deactive_deals_ids_by_cat,1,0,0,$display);
          }else{ ?>
              <p class="not-found">Sorry! No deal found.</p>
              <span>Please go <a href="<?php echo site_url();?>"> FindsDeals.com</a>  to see a lot of the lastest deals.</span>
          <?php }
       ?>
    </div>
</div>
<?php
	get_footer();
?>